package com.bridgeintelligent.tag.webserver.dim.query.service;

import com.bridgeintelligent.tag.webserver.dim.query.api.DimLastMonthRsp;
import com.bridgeintelligent.tag.webserver.dim.query.api.DimMonitorDetailRsp;
import com.bridgeintelligent.tag.webserver.dim.query.api.DimTop10Rsp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "标签历史监控")
@AllArgsConstructor
@RestController
@RequestMapping(value = "/api/query/monitor")
public class QueryHistoryController {

    private QueryApiUtils queryApiUtils;

    @ApiOperation(value = "", notes = "上个月")
    @PostMapping("/last")
    DimLastMonthRsp lastMonth(String condition){
        HistoryMonitorApi api = queryApiUtils.build(HistoryMonitorApi.class);
        return api.lastMonth(condition);
    }

    @ApiOperation(value = "", notes = "top10")
    @PostMapping("/top10")
    DimTop10Rsp top10(String condition){
        HistoryMonitorApi api = queryApiUtils.build(HistoryMonitorApi.class);
        return api.top10(condition);
    }

    @ApiOperation(value = "", notes = "详情")
    @PostMapping("/detail")
    DimMonitorDetailRsp detail(String condition){
        HistoryMonitorApi api = queryApiUtils.build(HistoryMonitorApi.class);
        return api.detail(condition);
    }
}
